package com.sophialex.health.record.lktable;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;

import com.sophialex.health.system.frame.resource.RcpResourceManager;
import com.sophialex.health.system.lktable.LKCellEditBase;
import com.sophialex.health.system.lktable.LKTable;



/**
 * 编辑策略
 * 
 * @author L.P
 * 
 */
public class InLkCellEditBase extends LKCellEditBase {

	@Override
	public Boolean doAfterClose(LKTable lkTable, Object obj, String feild) {
//		try {
//			Calendar c = Calendar.getInstance();
//			SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//			InOutEntity ioe = (InOutEntity) obj;
//			if (ioe != null && ioe.getFxq() != null) {
//				Date date = df.parse(df.format(c.getTime()));
//				if (ioe.getFxq().getTime() < date.getTime()) {
//					DialogManager.invokeConfirmDlg("效期录入错误(不能小于当前日期)!");
//					ioe.setFxq(date);
//				}
//			}
//		} catch (Exception e) {
//			// TODO: handle exception
//		}
//		lkTable.update(obj, feild);
//		lkTable.redraw();
		return super.doAfterClose(lkTable, obj, feild);
	}

	@Override
	public void doAfterCreate(LKTable lkTable, Object obj, String feild,
			Control mControl) {
		mControl.setBackground(RcpResourceManager.getColor(SWT.COLOR_WHITE));
		super.doAfterCreate(lkTable, obj, feild, mControl);
	}

	@Override
	public void doAfterOpen(LKTable lkTable, Object obj, String feild,
			Control mControl) {
		// TODO Auto-generated method stub
		super.doAfterOpen(lkTable, obj, feild, mControl);
	}

	@Override
	public boolean doBeforeOpen(LKTable lkTable, Object obj, String feild) {
		// TODO Auto-generated method stub
		return super.doBeforeOpen(lkTable, obj, feild);
	}

}
